  public function getPager($model)
  {
    $class = $this->getPagerClass();

    return new $class($model, $this->getPagerMaxPerPage());
  }

  public function getPagerClass()
  {
    return '<?php echo isset($this->config['list']['pager_class']) ? $this->config['list']['pager_class'] : 'sfPropelPager' ?>';
<?php unset($this->config['list']['pager_class']) ?>
  }

  public function getPagerMaxAllowedPerPage()
  {
    return <?php echo isset($this->config['list']['max_allowed_per_page']) ? (integer) $this->config['list']['max_allowed_per_page'] : 100 ?>;
<?php unset($this->config['list']['max_allowed_per_page']) ?>
  }

  public function getPagerDefaultMaxPerPage()
  {
    return <?php echo isset($this->config['list']['max_per_page']) ? (integer) $this->config['list']['max_per_page'] : 20 ?>;
<?php unset($this->config['list']['max_per_page']) ?>
  }

  public function getPagerMaxPerPage()
  {
    $value = sfContext::getInstance()->getUser()->getAttribute('<?php echo $this->getModuleName() ?>.max_per_page', $this->getPagerDefaultMaxPerPage(), 'admin_module');
    if (intval($value) > 0 && intval($value) <= $this->getPagerMaxAllowedPerPage())
    {
      return $value;
    }
    else
    {
      $this->setPagerMaxPerPage($this->getPagerDefaultMaxPerPage());
      return $this->getPagerDefaultMaxPerPage();
    }
  }

  public function setPagerMaxPerPage($max)
  {
    sfContext::getInstance()->getUser()->setAttribute('<?php echo $this->getModuleName() ?>.max_per_page', $max, 'admin_module');
  }


